<template>
    <div class="main">
        <PageTitle title="账户设置"></PageTitle>
        <el-table :data="tableData" style="width: 100%">
            <el-table-column  prop="username" label="所属用户"></el-table-column>
            <el-table-column  prop="name" label="姓名"></el-table-column>
            <el-table-column  prop="phone" label="手机号"></el-table-column>
            <el-table-column  prop="card" label="卡号"></el-table-column>
            <el-table-column  prop="back_name" label="银行名称"></el-table-column>
            <el-table-column  prop="bank" label="开户银行地址"></el-table-column>            
        </el-table>
        <div class="pagination-wrapper">
            <el-pagination
                layout="prev, pager, next"
                @current-change="pageChange"
                :page-size="pageSize"
                :total="totalCount"
                :current-page="pageNum"
            ></el-pagination>
        </div>
    </div>
</template>
<script>
import PageTitle from "@/components/pageTitle/PageTitle.vue";
export default {
    components: {
        PageTitle
    },
    data(){
        return{
            tableData: [],
            pageNum: 1,
            pageSize: 10,
            totalCount: 0,
            user_state:localStorage.getItem('user_state')
        }
    },
    created(){
        this._getList()
    },
    methods:{
        async _getList() {
            let {data: { data, code }} = await this.$axios({
                url: this.$api + "/v1/account/show",
                method: "GET",
                params: {
                    size: this.pageSize,
                    current: this.pageNum,
                    state: this.status,
                    title: this.search
                }
            });
            console.log('列表数据---------',data)
            if (code == 0) {
                this.tableData = data.items;
                this.totalCount = parseInt(data.pages.totalCount);
            }
        },
        pageChange(pageNum) {
            this.pageNum = pageNum
        }
    }
}
</script>